cc.Class({
    extends: cc.Component,

    properties: {
        target:{
            default:null,
            type:cc.Node
        },
        angle:[cc.Integer]
    },

    // use this for initialization
    onLoad: function () {
        
    },

    onBeginContact:function (contact, selfCollider, otherCollider) {
        let tag = selfCollider.tag;
        let target = this.target.getComponent('camera');
        if(target.dir != this.angle[tag]){
           target.dir = this.angle[tag]; 
        }
    },

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
